package com.qf.leadnewsuser.controller.v1;

import com.qf.leadnewsmodel.dtos.ResponseResult;
import com.qf.leadnewsuser.model.dtos.LoginDto;
import com.qf.leadnewsuser.service.ApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.NoSuchAlgorithmException;

@RestController
@RequestMapping("/api/v1")
public class UserController {

    @Autowired
    private ApUserService apUserService;

    @PostMapping("/login/login_auth")
    public ResponseResult login(@RequestBody LoginDto loginDto) throws NoSuchAlgorithmException {
        ResponseResult result = apUserService.login(loginDto);
        return result;
    }
}
